home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / byteorder.man < prev    next >
Encoding:
Text File  |  1989-08-29  |  1.7 KB  |  67 lines

  1.  
  2.  
  3.  
  4. BYTEORDER             C Library Procedures              BYTEORDER
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      htonl, htons, ntohl, ntohs - convert values between host and
  10.      network byte order
  11.  
  12. SSYYNNOOPPSSIISS
  13.      ##iinncclluuddee <<ssyyss//ttyyppeess..hh>>
  14.      ##iinncclluuddee <<nneettiinneett//iinn..hh>>
  15.  
  16.      nneettlloonngg == hhttoonnll((hhoossttlloonngg));;
  17.      uu__lloonngg nneettlloonngg,, hhoossttlloonngg;;
  18.  
  19.      nneettsshhoorrtt == hhttoonnss((hhoossttsshhoorrtt));;
  20.      uu__sshhoorrtt nneettsshhoorrtt,, hhoossttsshhoorrtt;;
  21.  
  22.      hhoossttlloonngg == nnttoohhll((nneettlloonngg));;
  23.      uu__lloonngg hhoossttlloonngg,, nneettlloonngg;;
  24.  
  25.      hhoossttsshhoorrtt == nnttoohhss((nneettsshhoorrtt));;
  26.      uu__sshhoorrtt hhoossttsshhoorrtt,, nneettsshhoorrtt;;
  27.  
  28. DDEESSCCRRIIPPTTIIOONN
  29.      These routines convert 16 and 32 bit quantities between net-
  30.      work byte order and host byte order.  On machines such as
  31.      the SUN these routines are defined as null macros in the
  32.      include file <_n_e_t_i_n_e_t/_i_n._h>.
  33.  
  34.      These routines are most often used in conjunction with
  35.      Internet addresses and ports as returned by
  36.      _g_e_t_h_o_s_t_b_y_n_a_m_e(3N) and _g_e_t_s_e_r_v_e_n_t(3N).
  37.  
  38. SSEEEE AALLSSOO
  39.      gethostbyname(3N), getservent(3N)
  40.  
  41. BBUUGGSS
  42.      The VAX handles bytes backwards from most everyone else in
  43.      the world.  This is not expected to be fixed in the near
  44.      future.
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63. Sprite v1.0               May 15, 1986                          1
  64.  
  65.  
  66.  
  67.